package moni.anyou.com.view.bean.request;

import com.google.gson.Gson;

import java.util.HashMap;
import java.util.Map;

import moni.anyou.com.view.bean.request.base.RequestStandard;
import moni.anyou.com.view.config.SysConfig;

/**
 * Created by Administrator on 2017/2/9.
 */

public class ReqHomeBean extends RequestStandard{

    String teamid = "0";
    public static ReqHomeBean cmd(int cmd){
        return cmd(String.valueOf(cmd));
    }

    public static ReqHomeBean cmd(String cmd){
       return new ReqHomeBean(cmd,SysConfig.uid,SysConfig.token,SysConfig.cid);
    }
    public static ReqHomeBean cmd(String cmd,String teamID){
        return new ReqHomeBean(cmd,SysConfig.uid,SysConfig.token,SysConfig.cid,teamID);
    }
    public static class BaseMap extends HashMap {
        public BaseMap keyValue(Object a,Object b)
        {
            put(a,b);
            return this;
        }
    }
    public static BaseMap create(int cmd){
        return create(String.valueOf(cmd));
    }

    public static BaseMap create(String cmd){
        return new Gson().fromJson(new Gson().toJson(new ReqHomeBean(cmd,SysConfig.uid,SysConfig.token,SysConfig.cid)),BaseMap.class);
    }

    public ReqHomeBean(String cmd, String uid, String token,String cid) {
        super(cmd,  uid,  token,cid);
    }
    public ReqHomeBean(String cmd, String uid, String token,String cid,String teamID) {
        super(cmd,  uid,  token,cid);
        this.teamid = teamID;
    }
    public ReqHomeBean(String cmd, String uid, String token) {
        super(cmd,  uid,  token);
    }

    @Override
    public String ToJsonString() {
        String rmsg="fail";
        if (this != null) {
            rmsg=new Gson().toJson(this,ReqHomeBean.class);
        }
        return rmsg;
    }
}
